#include "MainFrame/MenuBar/ImageMenuList.h"
#include <QEvent>


ImageMenuList::ImageMenuList(const QString &title, QWidget *parent) :
    MenuListBase(title, parent),
    m_pduplicateAction(nullptr),
    m_pmodeAction(nullptr),
    m_ptransformAction(nullptr),
    m_pcanvasSizeAction(nullptr),
    m_pscaleAction(nullptr),
    m_pCropAction(nullptr),
    m_pmergeVisibleLayersAction(nullptr)
{
    m_pduplicateAction = addOneAction("Duplicate", this);
    m_pmodeAction = addOneAction("Mode", this);
    m_ptransformAction = addOneAction("Transform", this);
    m_pcanvasSizeAction = addOneAction("Canvas Size", this);
    m_pscaleAction = addOneAction("Scale", this);
    m_pCropAction = addOneAction("Crop", this);
    m_pmergeVisibleLayersAction = addOneAction("Merge Visible Layers", this);

    connect(m_pduplicateAction, SIGNAL(triggered()), this, SLOT(duplicateSlot()));
    connect(m_pmodeAction, SIGNAL(triggered()), this, SLOT(modeSlot()));
    connect(m_ptransformAction, SIGNAL(triggered()), this, SLOT(transformSlot()));
    connect(m_pcanvasSizeAction, SIGNAL(triggered()), this, SLOT(canvasSizeSlot()));
    connect(m_pscaleAction, SIGNAL(triggered()), this, SLOT(scaleSlot()));
    connect(m_pCropAction, SIGNAL(triggered()), this, SLOT(CropSlot()));
    connect(m_pmergeVisibleLayersAction, SIGNAL(triggered()), this, SLOT(mergeVisibleLayersSlot()));
}

ImageMenuList::~ImageMenuList()
{

}

void ImageMenuList::changeEvent(QEvent *event)
{
    QWidget::changeEvent(event);
    switch (event->type())
    {
    case QEvent::LanguageChange:
        initTrans();
        break;
    default:
        break;
    }
}

void ImageMenuList::initTrans()
{
    m_pduplicateAction->setText(tr("Duplicate"));
    m_pmodeAction->setText(tr("Mode"));
    m_ptransformAction->setText(tr("Transform"));
    m_pcanvasSizeAction->setText(tr("Canvas Size"));
    m_pscaleAction->setText(tr("Scale"));
    m_pCropAction->setText(tr("Crop"));
    m_pmergeVisibleLayersAction->setText(tr("Merge Visible Layers"));
}

void ImageMenuList::duplicateSlot()
{

}

void ImageMenuList::modeSlot()
{

}

void ImageMenuList::transformSlot()
{

}

void ImageMenuList::canvasSizeSlot()
{

}

void ImageMenuList::scaleSlot()
{

}

void ImageMenuList::CropSlot()
{

}

void ImageMenuList::mergeVisibleLayersSlot()
{

}
